import pymysql


def get_conn():
    con = pymysql.connect(
        host="litemall.hogwarts.ceshiren.com",
        port=13306,
        user="test",
        password="test123456",
        database="litemall",
        charset="utf8mb4"
    )
    return con


def execute_conn(sql):
    connect = get_conn()
    cur = connect.cursor()
    cur.execute(sql)
    record = cur.fetchone()
    return record



res = execute_conn("select * from litemall_cart")
print(res)
